package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.domain.db.BlackList;
import com.itheima.domain.db.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

// 黑名单
public interface BlackListMapper extends BaseMapper<BlackList> {

    // 自定义sql分页查询
    @Select("SELECT * FROM `tb_user_info` info INNER JOIN `tb_black_list` black ON  info.`id` = black.`black_user_id` WHERE black.`user_id` = #{userId}")
    Page<UserInfo> findBlackListUserInfoByPage(Page page, @Param("userId") Long userId);

}